#ifndef LOGIN_H
#define LOGIN_H

#include <QWidget>
#include <QPushButton>
#include <QTcpSocket>
#include "widget.h"
#include "register.h"
namespace Ui {
class Login;
}

class Login : public QWidget
{
    Q_OBJECT

public:
    explicit Login(QWidget *parent = nullptr);
    ~Login();
    QTcpSocket *tcpClient;
    qint16 port;
    QString getLocalIP();

private slots:
    void on_loginpushButton_clicked();

    void on_registerpushButton_clicked();
    void onConnected();
    void onDisconnect();
    void processPendingDatagrams();

private:
    void showChatWidget();
    void showRegisterWidget();
    Widget *chatWidget;
    Register *registerWidget;
    Ui::Login *ui;
};

#endif // LOGIN_H
